﻿using System.Collections.Generic;
using Caliburn.Micro;

namespace YiJing.Tasks
{
    public static class Show
    {
        public static void Execute(this IEnumerable<IResult> tasks, ActionExecutionContext context = null)
        {
            if (tasks == null) return;
            Coroutine.BeginExecute(tasks.GetEnumerator(), context);
        }

        public static OpenDialog<TDialog> Dialog<TDialog>() where TDialog : class, IDialog
        {
            var dialog = IoC.Get<TDialog>();
            IoC.BuildUp(dialog);
            return new OpenDialog<TDialog>(dialog);
        }
    }
}